package com.gzsxy.esjy.bus;


import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gzsxy.esjy.bus.dao.OperlogMapper;
import com.gzsxy.esjy.bus.message.MessageFactory;
import com.gzsxy.esjy.bus.message.impl.MessageFactoryImpl;
import com.gzsxy.esjy.bus.service.IOperlogService;
import com.gzsxy.esjy.bus.service.impl.IOperlogServiceImpl;
import com.gzsxy.esjy.bus.subscrib.DefaultMessageListener;
import com.gzsxy.esjy.bus.subscrib.DefaultStream;

import com.gzsxy.esjy.service.base.dto.request.OperlogRequest;
import org.omg.CORBA.PUBLIC_MEMBER;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.binding.BinderAwareChannelResolver;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.Map;


/**
 * @author xiaolong
 * @version 1.0
 * @description: 将消息自定义通道消息注入容器bean
 * @date 2021/10/12 9:16
 */
@Configuration
@EnableBinding(DefaultStream.class)
public class AutoConfiguration {

    @Bean
    public DefaultMessageListener defaultMessageListener() {
        return new DefaultMessageListener();
    }

    @Bean
    @ConditionalOnMissingBean(MessageFactory.class)
    public MessageFactory messageFactory(BinderAwareChannelResolver resolver) {
        return new MessageFactoryImpl(resolver);
    }






}
